package main

import (
	"fmt"
	feeds "git.oschina.net/fanbuchi/xgggh/feeds/srv/proto/feed"
	"golang.org/x/net/context"
	"github.com/micro/go-micro/metadata"
	"github.com/micro/go-micro"
	"github.com/micro/go-micro/cmd"
)

func main() {
	cmd.Init()
	service:=micro.NewService()
	service.Init()

	// Use the generated client stub
	cl := feeds.NewFeedClient("com.xgggh.srv.feeds", service.Client())

	// Set arbitrary headers in context
	ctx := metadata.NewContext(context.Background(), map[string]string{
		"token": "token_111111",
		"X-From-Id": "script",
	})


	// Make request
	rsp, err := cl.Create(ctx, &feeds.FeedCreateReq{
		Mobile:"1111",
		Feed:"tianfu three street",
		Geo:"30.4564,104.542",
	})
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(rsp.FeedId)
}
